import React from 'react'
import { useTranslation } from 'react-i18next';
import i18n from '../i18n/index';
import { Button } from 'antd';

import { store } from '../store/Index';
import { useSelector } from 'react-redux';
function Home() {
  const  cityList=useSelector(store=>store.city.cityList)
   const {code}=useSelector(store=>store.city.cityList)
    const { t, i18n } = useTranslation();
const quehuan=()=>{
    i18n.changeLanguage(i18n.language=== 'zh' ? 'en' : 'zh')
}
  return (
    <div>
        <h1>{t('holle')},{t('name')},{t('age')}</h1>
      <Button onClick={()=>quehuan()}>切换{i18n.language==='zh'?'英文':"中文"}</Button>
      <div>{cityList.name}</div>
      {code}
    </div>
  )
}

export default Home
